﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/resources/include/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>数据字典 - 添加数据</title>
<meta name="renderer" content="webkit" />
<meta name="decorator" content="default"/>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<ptags:staticfile/>
<script type="text/javascript" src="${ctx }/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${ctx }/resources/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="${ctx }/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
<link rel=stylesheet href="${ctx }/resources/ueditor/themes/default/css/ueditor.css">
<script type="text/javascript" charset="utf-8" src="${ctx }/resources/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
<style type="text/css">
.tableCls{ border-collapse: collapse;border: none;margin:2}
.tdCls{ border: solid #323232 1;padding:2;align=center;valign=center}
</style>
<script type="text/javascript">
$(document).ready(function(){
    $("#inputForm").validationEngine();
    
	var ue = UE.getEditor("editor",{
        theme:"default", //皮肤
        wordCount:false,
        elementPathEnabled:false,
        initialFrameWidth:'100%',
        initialFrameHeight:1000,
        zIndex:99,
        readonly :true,
        toolbars:[],
		'enterTag':'br' 
	});
	
	ue.ready(function() {
	    ue.execCommand('serverparam', {
	        "folder":"${dirIds }"
	    });
	});
});

function save(){
	var url = "${ctx}/sys/dict/save";
	$.ajax({
		url:url,
		type:'post',
		async: false,
		dataType:'json',
		data:{
			sort:$("#sort").val(),
			parent_id:$("#parent_id").val(),
			dict_name:$("#dict_name").val(),
			dict_value:$("#dict_value").val(),
			dict_depict:$("#dict_depict").val(),
		},
		success:function(result){
			window.location = "${ctx}/sys/dict/content?id="+result;
			var iframe = window.parent.document.getElementById("fr_tree_content");
			iframe.contentWindow.location.reload(true);
		}
	});
}

function htmlDialogShow(div_id){
	var userTreeHTML = "<div id=\"app_pop\" style=\"width: 320px;background-color: #E8E7D9;color:#323232;padding:8\">" 
							+$("#"+div_id).html()+
						"</div>";
	tableList.app.popDialog('预览窗口',userTreeHTML,'480','320','htmlshow');
	$("#app_pop table").addClass("tableCls");
	$("#app_pop td").addClass("tdCls");
	$('.htmlshow').click(function(){
		app.close('htmlshow');
	});
}

</script>

</head>
<body>
<div class="col_12">
	<div class="nav">
		<span>邮箱管理&gt;&gt;${knowledge.catalog.name }信息</span>
	</div>
    <form:form name="inputForm" id="inputForm" method="post" modelAttribute="knowledge">
    	<input type="hidden" name="dir_id" id="dir_id" value="${knowledge.catalog.id }">
    	<input type="hidden" name="dir_ids" id="dir_ids" value="${knowledge.catalog.dir_ids }">
    	<input type="hidden" name="sub_id" id="sub_id" value="${knowledge.catalog.sub_id }">
	    <div class="table_header">
	        <div class="table_btn_box_left">
	            <a href="${ctx}/curr/know/form?dirid=${knowledge.catalog.id }" class="btn btn-primary fl">编辑</a>
	        	<a href="javascript:htmlDialogShow('htmlContext');" class="btn btn-primary btn-table">小屏幕预览</a>
	        	<div style="display: none;" id="htmlContext">${knowledge.backups }</div>
	        </div>
	        <div class="clear"></div>
	    </div>
		<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_list">
		    <tr>
		        <td align="right">标题:</td>
		        <td>${knowledge.catalog.name }</td>
		        <td align="right">目录:</td>
		        <td>${knowledge.catalog.name }</td>
		        <td align="right">序号:</td>
		        <td>${knowledge.serialno }</td>
		    </tr>
		    <tr>
		        <td align="right">索引:</td>
		        <td colspan="5">${knowledge.search_key }</td>
		    </tr>
		    <tr>
		        <th align="right" colspan="6">内容:</th>
		    </tr>
		    <tr>
		        <td colspan="6">
		        	<c:if test="${knowledge.content == null }">
		        		暂无内容
		        	</c:if>
		        	<c:if test="${knowledge.content != null }">
						<script type="text/javascript" id="editor" name ="content" disabled>
							${knowledge.content }
						</script>
		        	</c:if>
		        </td>
		    </tr>
		</table>
    </form:form>
</div>
</body>
</html>
